home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
013a
/
envlpe.zip
/
ENVELOPE.DOC
< prev
Wrap
Text File
|
1991-10-24
|
7KB
|
107 lines
*****************************************************************************
* PROGRAM - envelope.bas AUTHOR - Anthony Badger DATE - Sept. 27, 1991 *
*****************************************************************************
This program prints out a 5 line address on a business envelope with the
Hewlett Packard LaserJet Series II printer. This program has not been tested
on any other printer, but it is my understanding it should work on any laser
printer compatable with HP LJII commands and has manual feed. The program can
be modified to work on any laser printer be changing one line of commands.
The program is free for all to use, copy, change, mangle, etc. I only ask
that my name remain in the program and documentation as the original author.
A few dollars to further my programming efforts would be appreciated, but I do
not expect any for this program. However, if there is a program you need or
would like to see, I'd be happy to try and write it for you as shareware.
I am about to begin writing a bank account program that can be easily
customized to suit your needs and your bank. If anyone has suggestions, please
feel free to contact me.
My home address and network addresses:
Anthony G. Badger CompuServe : 72437,3350
81 Belmont Avenue GEnie : T.BADGER
No. Plainfield, NJ 07060-4362 Delphi : TONYBADGER
END-USER DOCUMENTATION
----------------------
The contents of the LZH package should be ENVELOPE.BAS, ENVELOPE.DOC, and a
batch file called ENVELOPE.BAT. The batch file contains the command:
C:\DOS\BASICA C:\DOS\ENVELOPE.BAS
If you have a different BASIC language, substitute its path for \DOS\BASICA.
This language should be Microsoft compatable. Also please add the full path
name to ENVELOPE.BAS. If you have it in a directory called \APPS, and you
have GWBASIC in \DOS, the file should read:
C:\DOS\GWBASIC C:\APPS\ENVELOPE.BAS
To run the program, just CD to the directory with the ENVELOPE.BAT file and
type:
ENVELOPE
Or use your menu system to run the ENVELOPE.BAT file.
The screen will clear and some instructions and rows of dots will appear. The
cursor moves to the first row of dots and you enter the address. The dots
simply show the maximum length each line can be. All characters past the last
dot will be truncated. If a line is truncated, a warning will appear to the
right of the line. For a blank line, just press ENTER with nothing typed on
that line. Any dots remaining on a line will be erased to avoid confusion, and
any line that needed truncating will have the extra letters erased.
To correct mistakes on the line you are typing on, use the BACKSPACE key, NOT
the arrow keys or DELETE! If you notice an error on a line you have already
finished, you will be able to correct it later. It is IMPORTANT that you never
press the arrow keys! The program is set up for line input, not full screen
editing.
After the address is entered, you are asked if it is correct. Pressing 'n'
will allow you to edit the lines. To leave a line unchanged, just press ENTER.
To correct a line, you must retype the ENTIRE line. Again, NO ARROW KEYS! You
also have the option of quitting the program at this point by pressing 'q'.
When the address is correct and you have pressed 'y', some printer instructions
are given for the HP LaserJet II. The back tray is opened to keep the envelope
from curling up too much. When the printer display reads "PE FEED COM-10", you
insert the envelope. The envelope is inserted into the manual feed guides with
the left edge pointing out and the envelope face up. If you are using envelopes
with return addresses pre-printed, you should be able to see it on the left.
The address is printed on the envelope and you are asked if you wish to print
another. 'y' re-runs the program, 'n' exits with a little warning message.
The FORM FEED light will be on the printer, but it will have no effect on
future printouts. A blank page might print the next time the printer is used,
but no harm is done to your next printout. If you print out a second address,
a blank page will print out before you are asked to insert the envelope. If
you find this annoying, use the RESET function of the printer command panel
to remove the FORM FEED light.
FOR THE CURIOUS PROGRAMMERS OUT THERE
-------------------------------------
For those of you who are curious about the program or just programming, here
are a few tidbits. This is a structured BASIC program, meaning it is divided
into sub-routines and a main module, with variables declared before hand (using
REM statements and definition of constants). The program could just as easily
have been written unstructured (in fact, the original version was), but a
structured program is much easier to follow, with as few GOTOs as possible
(the only GOTO in the program is line 820, which is unavoidable, 3 WHILE-WEND
loops are used to avoid GOTOs and branching).
The code itself is, as I mentioned to a friend, quite short. The rest is fluff
used to make the program readable and the execution look more professional.
This is the 3rd version of the program. The first was a 6 line program that
printed out a specific address and was used to find the proper codes and
spacing. The second was unstructured but essentially the same as this third
version. Personally, I do not like BASIC, but it was all that had available.
After reading the second code, I just had to make it structured (PASCAL and
COBOL are forever in my blood).
If you are embarking on a similar program (a short specific purpose program),
I suggest you do much the same thing, leaving out an 'unstructured' phase.
After experimenting with the 'meat' of the program, write a pseudocode for
the entire program. This is like a flowchart, but in English (any good COBOL
or structured language book should have a section on flowhcarting and pseudo-
code. So the evolution of the program is EXPERIMENT -> PSEUDOCODE -> CODE.
Then test it as thoroughly as possible, have others who know nothing about the
program try and use it. Put plenty of comments in your program. Not very
obvious comments, but explanatory comments that explain your thinking during
the coding. This simple method ensures reliable programming and very readable
program code.